package com.shqcjd.sinopecdemomobile.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.shqcjd.sinopecdemomobile.R;
import com.shqcjd.sinopecdemomobile.model.pojo.InspectionStandardBean;

import java.util.List;

public class InspectionStandardAdapter extends BaseAdapter {

    private List<InspectionStandardBean.ItemsBean> mList;
    private LayoutInflater inflater;

    public InspectionStandardAdapter(List<InspectionStandardBean.ItemsBean> mList, Context context) {
        this.mList = mList;
        this.inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }


    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        //加载布局为一个视图
        View view = inflater.inflate(R.layout.item_inspect_standard, null);
        TextView tv_item_inspection_standard_position = view.findViewById(R.id.tv_item_inspection_standard_position);
        TextView tv_item_inspection_standard_project = view.findViewById(R.id.tv_item_inspection_standard_project);
        TextView tv_item_inspection_standard = view.findViewById(R.id.tv_item_inspection_standard);
        tv_item_inspection_standard_position.setText(mList.get(position).part);
        tv_item_inspection_standard_project.setText(mList.get(position).item);
        tv_item_inspection_standard.setText(mList.get(position).stand);
        return view;
    }

}